<?php

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_Backend
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: topnav.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */
$file = APPLICATION_PATH . "/layouts/backend_menu.xml";	
$config = new Zend_Config_Xml($file, 'nav');
$container = new Zend_Navigation($config);
if(Zend_Controller_Front::getInstance()->getRequest()->getActionName()!="login")

echo $this->navigation()->topMenu()->renderMenu($container, array('ulClass'=> 'nav top-nav'));

$this->headScript()->captureStart();
?>
$().ready(function() {
	$("#navbar>ul>li>ul").each(function(i){
		  if($(this).find("li").length==0){
			  $(this).parent().remove(); 
		  }
	 }); 
	$("#accordion>div").each(function(i){
		 if(this.innerHTML.indexOf("ul") == -1){
			 $(this).remove();
		 }
    });
	
});

<?php
$this->headScript()->captureEnd();  
?>
